//LudidDreaming_Text.java: A Text Based Programming Summative
//Created by Alan Li and Matthew Tsang for Mrs. Strelkovska's ICS3U1-01 Computer Science class.

import game.info.*;
import game.system.*;

import java.util.*;
import java.io.*;

public class LucidDreaming_Text {
	
	public static void main(String[] args) throws Exception {
		
		String output = "";
		Scanner contentReader = new Scanner (new File("src/content.txt")); 
		
		GameData	gd = new GameData();
		Player		p = new Player();
		MainGame	mg = new MainGame(); 
		
		String[][][][] rooms;
		
		do {
		
			for(int i = 1; i < 70; i++) {
			
				output = contentReader.nextLine();
				System.out.println(output);
			
			}
      
          System.out.println();
          System.out.print("ENTER OPTION: ");
          
          switch (menu()) { //TODO Try/Catch "Exception E"
          case 1: gd.create(p); mg.main(args); break;// new player
          case 2: rooms = gd.load(p); mg.main(args); break;// load saved game
          case 3: instructions(); break;
          case 4: System.exit(0); break;
          default: System.out.println("    Please enter \"1\" for GAME START, \"2\" for LOAD GAME,\"3\" for INSTRUCTIONS, \"4\" for UNLOCKED ENDINGS and \"5\" to QUIT.");
		
          }  
          
      } while (menu() != 4);

	}
	
  public static void instructions() {
     
     System.out.println();
     System.out.println("    Lucid Dreaming is a text based room escape game.");
     System.out.println();
     System.out.println("    Essentially, the player enters strings and the program");
     System.out.println("    extracts the key terms in order to read the players commands.");
     System.out.println();
     System.out.println("    Try using key words such as \"LOOK\", \"GET\", and \"GO\"");
     System.out.println("    to start off, although you may discover more commands further");
     System.out.println("    along in the game.");
     System.out.println();
     System.out.println("    You can use the \"SAVE\" and \"EXIT\" commands to");
     System.out.println("    save and exit the game at any time.");
     
  }
	
	// Main menu
	public static int menu(){
		int option;
		Scanner input = new Scanner(System.in);
		do {
			System.out.print("	");
			option = input.nextInt();
			
		}while (option < 0 || option > 5);
			
		return option;
	}
}